package com.hunliji.monitor.web.controller.app;

import com.hunliji.common.response.ResponseData;
import com.hunliji.monitor.web.facade.DbFacade;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 数据库操作相关
 * @author wuchen
 */
@RestController
@RequestMapping("/db")
public class DbController {
    @Resource
    private DbFacade dbFacade;

    @PostMapping("/initDbFromInstance")
    public ResponseData initDbFromInstance(@RequestParam("id") Long id){
        dbFacade.initDbFromInstance(id);
        return ResponseData.success(null);
    }
}
